home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
B-Business
/
(c)b2.d64
/
bio-ploter.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
140 lines
1000 REM******************************
1010 REM* *
1020 REM* THIS ADAPTATION FOR PET *
1030 REM* *
1040 REM* BY *
1050 REM* *
1060 REM* D. S. PENNER *
1070 REM* *
1080 REM* JUNE-ISH 1980 *
1090 REM* *
1100 REM******************************
1110 PRINT"[147]"
1120 AA$=" BIORHYTHM PLOTTER"
1130 AB$="ON ENTRY OF BIRTH DATE AND A STARTING"
1140 AC$="DATE, PLOTS A SHORT CHART [ 20 DAYS ]."
1150 AD$="TO CONTINUE ON; PRESS THE SPACE BAR."
1160 AE$="TO END; PRESS Z ."
1170 AF$="TO START WITH A NEW DATE; PRESS S ."
1180 PRINTAA$
1190 PRINT""
1200 PRINTAB$
1210 PRINT"";AC$
1220 PRINT"";AD$
1230 PRINT"";AE$
1240 PRINT"";AF$
1250 GETZ$:IFZ$=""GOTO1250
1260 DEF FNI(X)=SGN(X)*INT(ABS(X))
1270 DEF FNF(X)=X-FNI(X)
1280 DIM F(12),J(2),O$(51)
1290 K=2*(null)
1300 FORI=1TO12:READF(I)
1310 NEXT I
1320 DATA31,28,31,30,31,30,31,31,30,31,30,31
1330 PRINT"[147]"
1340 INPUT"BIRTH DATE: MM,DD,YYYY ";M1,D1,Y1
1350 M=M1:D=D1:Y=Y1:GOSUB 2360
1360 Q1=JD
1370 M2=M1:D2=D1:Y2=Y1
1380 GOSUB 1860
1390 PI=P2
1400 PRINT
1410 INPUT"STARTING DATE: MM,DD,YYYY ";M2,D2,Y2
1420 M=M2:D=D2:Y=Y2:GOSUB 2360
1430 Q2=JD:QF=Q2-Q1
1440 GOSUB 1860
1450 REM CALCULATES OFFSET
1460 X=M1:GOSUB1960
1470 JI=J2+D1+Y1*365
1480 IF J1<639723 THEN PI=8
1490 X=M2:GOSUB 1960
1500 J2=J2+D2+Y2*365
1510 IFJ2<639723 THENP2=8
1520 N1=Y2-.1
1530 O=J2-J1+INT(N1/4)-INT(Y1/4)-INT(N1/100)+INT(Y1/100)+INT(N1/400)-INT(Y1/400)
1540 IFM1>2THEN1570
1550 X=Y1:GOSUB2020
1560 O=O+X
1570 IFM2>3THEN 1600
1580 X=Y2:GOSUB 2020
1590 O=O+X
1600 REM PRINT HEADER
1610 PRINT"[147]"
1620 PRINTTAB(7);"DOWN";TAB(20);"CRITICAL";TAB(38);"UP"
1630 H$="----------------!----------------"
1640 PRINT TAB(7);H$
1650 REM SET F(2) TO 29 FOR LP YRS
1660 X=Y2
1670 F(2)=F(2)+X
1680 REM MAKA DE CHART
1690 Y=QF
1700 PRINT""
1710 FOR O=OTO O+19
1720 PRINTM2;"/";D2;TAB(23);"!"
1730 REM INCRUMENT THE DATE
1740 IF P2=8 THEN 1770
1750 P2=P2+1
1760 IF P2>7 THEN P2=1
1770 D2=D2+1
1780 IF D2>F(M2)THEN GOSUB 2350
1790 IF M2<13 THEN 1810
1800 M2=1:Y2=Y2+1
1810 X=Y2:F(2)=28
1820 GOSUB 2020
1830 F(2)=F(2)+X
1840 NEXT O
1850 GOTO 2100
1860 REM FINDA DE DAZE OF DE WEEK
1870 N1=M2+12*INT(.6+1/M2)
1880 N2=Y2-INT(.6+1/M2)
1890 N3=INT(13*(N1+1)/5)
1900 N4=INT(5*N2/4)
1910 N5=INT(N2/100)
1920 N6=INT(N2/400)
1930 N7=N3+N4-N5+N6+D2-1
1940 P2=N7-7*INT(N7/7)+1
1950 RETURN
1960 REM DAZE IN PAST MONTHS
1970 J2=0
1980 FOR I=1 TO X-1
1990 J2=J2+F(I)
2000 NEXT I
2010 RETURN
2020 REM CHECK FOR LEAP YR
2030 IF X/400-INT(X/400)=0THEN2060
2040 IF X/100-INT(X/100)=0THEN2080
2050 IFX/4-INT(X/4)<>0THEN2080
2060 X=1
2070 RETURN
2080 X=0
2090 RETURN
2100 O=Y
2110 PRINT""
2120 FOR O=OTO O+19
2130 X=(SIN(K*(O/23-INT(O/23)))*15)+24
2140 P=X
2150 PRINTTAB(P);"P"
2160 NEXT O
2170 O=Y
2180 PRINT""
2190 FOR O=OTO O+19
2200 X=(SIN(K*(O/33-INT(0/33)))*15)+24
2210 I=X
2220 PRINTTAB(I);"I"
2230 NEXT O
2240 O=Y
2250 PRINT""
2260 FOR O=OTO O+18
2270 X=(SIN(K*(O/28-INT(O/28)))*15)+24
2280 E=X
2290 PRINTTAB(E);"E"
2300 NEXT O
2310 GETZ$:IF Z$="" THEN 2310
2320 IF Z$="Z" THEN END
2330 IF Z$="S" THEN 1330
2340 O=O+20:QF=QF+20:GOTO 1600
2350 D2=1:M2=M2+1:RETURN
2360 YY=Y+FNI((M-14)/12):MM=13+12*FNF((M-14)/12)
2370 JD=D+FNI((367*MM+5)/12)+FNI(365.25*(YY+4712))-2.5
2380 RETURN